package com.tamecode.bean.attr;

import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BeanTest {
    public static void main(String[] args) {
        // 1 父容器
//        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean/attr/beans-catenation.xml");
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean/attr/beans-mapWithGeneric.xml");
        Boss bean = applicationContext.getBean(Boss.class);
        System.out.println(bean.getJobTimes().size());

    }

    @Test
    public void mergeListTest() {
        // 1 父容器
//        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean/attr/beans-catenation.xml");
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean/attr/beans-mergeList.xml");
        Boss bean = (Boss) applicationContext.getBean("childBoss");
        System.out.println(bean.getFavorites().size());
    }
}
